package my.soft.aiteacher.teacher.controller;


import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import my.soft.aiteacher.common.pojo.VideoInformationVo;
import my.soft.aiteacher.common.service.IVideoInformationService;
import my.soft.aiteacher.teacher.pojo.CoursesVo;
import my.soft.aiteacher.teacher.pojo.VideoInformationToCourse;
import my.soft.aiteacher.teacher.service.ICoursesService;
import my.soft.aiteacher.utils.R;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 课程表 前端控制器
 * </p>
 *
 * @author GMCX
 * @since 2025-06-14
 */
@RestController
@Tag(name = "教师-课程管理")
@RequestMapping("/teacher/courses")
public class CoursesController {
    @Resource
    private IVideoInformationService videoInformationService;
    @Resource
    private ICoursesService coursesService;
    @Operation(summary = "创建课程")
    @RequestMapping(value = "/createCourse",method = RequestMethod.POST)
    public R createCourse(@RequestBody CoursesVo coursesVo){
        coursesService.createCourse(coursesVo);
        return R.success("ok");
    }
    @Operation(summary = "修改课程")
    @RequestMapping(value = "/updateCourse",method = RequestMethod.POST)
    public R updateCourse(@RequestBody CoursesVo coursesVo){
        coursesService.updateCourse(coursesVo);
        return R.success("ok");
    }
    @Operation(summary = "将视频添加到课程")
    @RequestMapping(value = "/addVideoToCourse",method = RequestMethod.POST)
    public R addVideoToCourse(@RequestBody VideoInformationToCourse videoInformationToCourse){
        videoInformationService.addVideoToCourse(videoInformationToCourse);
        return R.success("ok");
    }
}
